import java.util.InputMismatchException;
import java.util.Scanner;

public class Test2 {
    public static int getDate() {
        Scanner scanner = null;
        try {
            scanner = new Scanner(System.in);
            int date = scanner.nextInt();
            return date;
        } catch(InputMismatchException e) {
            e.printStackTrace();
        } finally {
            System.out.println("finally中代码");
            //一定会被执行
            scanner.close();

            //若在此返回数据 return 100; 则返回此数据 建议不要在finally中返回数据
        }
        return 0;
    }
}
